﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Pentakill
{
    public partial class MainForm : Form
    {
        Employee empForm = new Employee();
        Order orderForm = new Order();
        Products productForm = new Products();
        Customers cusForm = new Customers();
        Suppliers supForm = new Suppliers();
        Shipper shipForm = new Shipper("0");
        public MainForm()
        {
            InitializeComponent();
        }



        //    //cusForm.MdiParent = this;
        //    //cusForm.Show();


        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult result;
            result = MessageBox.Show("Are you want to exit?", "Exit", MessageBoxButtons.OKCancel);

            if (result == DialogResult.Cancel)
            {
                e.Cancel = true;
            }
        }

        private void btnCustomer_Click(object sender, EventArgs e)
        {
            empForm.Visible = false;
            shipForm.Visible = false;
            orderForm.Visible = false;
            productForm.Visible = false;
            supForm.Visible = false;
            cusForm.Visible = true;
            cusForm.MdiParent = this;
            panel1.Controls.Add(cusForm);
            cusForm.TopLevel = false;
            cusForm.Dock = DockStyle.Fill;
           
        }
        private void btnSuppliers_Click(object sender, EventArgs e)
        {
            cusForm.Visible = false;
            shipForm.Visible = false;
            orderForm.Visible = false;
            productForm.Visible = false;
            empForm.Visible = false;
            supForm.Visible = true;
            supForm.MdiParent = this;
            panel1.Controls.Add(supForm);
            supForm.TopLevel = false;
            supForm.Dock = DockStyle.Fill;
            
        }
        private void btnProducts_Click(object sender, EventArgs e)
        {
            cusForm.Visible = false;
            shipForm.Visible = false;
            orderForm.Visible = false;
            empForm.Visible = false;
            supForm.Visible = false;
            productForm.Visible = true;
            productForm.MdiParent = this;
            panel1.Controls.Add(productForm);
            productForm.TopLevel = false;
            productForm.Dock = DockStyle.Fill;
            
        }
        private void btnOrder_Click(object sender, EventArgs e)
        {
            shipForm.Visible = false;
            cusForm.Visible = false;
            empForm.Visible = false;
            supForm.Visible = false;
            productForm.Visible = false;
            orderForm.Visible = true;
            orderForm.MdiParent = this;
            panel1.Controls.Add(orderForm);
            orderForm.TopLevel = false;
            orderForm.Dock = DockStyle.Fill;
           
        }
        private void btnShipper_Click(object sender, EventArgs e)
        {
            cusForm.Visible = false;
            empForm.Visible = false;
            supForm.Visible = false;
            orderForm.Visible = false;
            productForm.Visible = false;  
            shipForm.Visible = true;
            shipForm.MdiParent = this;
            panel1.Controls.Add(shipForm);
            //shipForm.TopLevel = false;
            //shipForm.Dock = DockStyle.Fill;

           
        }
        private void btnEmployee_Click(object sender, EventArgs e)
        {
            cusForm.Visible = false;
            shipForm.Visible = false;
            orderForm.Visible = false;
            productForm.Visible = false;
            supForm.Visible = false;
            empForm.Visible = true;
            empForm.MdiParent = this;
            panel1.Controls.Add(empForm);
            empForm.TopLevel = false;
            empForm.Dock = DockStyle.Fill;

        }
        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
       


        private void btnProducts_MouseHover(object sender, EventArgs e)
        {
            tooltip.Show("PRODUCTS", btnProducts);
            
            
        }

        private void btnEmployee_MouseHover(object sender, EventArgs e)
        {
            tooltip.Show("EMPLOYEES", btnEmployee);
          
        }

        private void btnSuppliers_MouseHover(object sender, EventArgs e)
        {
            tooltip.Show("SUPPLIERS", btnSuppliers);
        
            
        }

        private void btnCustomer_MouseHover(object sender, EventArgs e)
        {
            tooltip.Show("CUSTOMERS", btnCustomer);
           
        }

        private void btnOrder_MouseHover(object sender, EventArgs e)
        {
            tooltip.Show("ORDERS", btnOrder);
            
        }

        private void btnShipper_MouseHover(object sender, EventArgs e)
        {
            tooltip.Show("SHIPPERS", btnShipper);
          
        }

  

     

       
    }
}

